<template>
  <uni-popup ref="scanEditPopup" type="dialog">
    <view class="scan-edit-popup">
      <view class="popup-header">
        <text class="title">串号</text>
        <uni-icons name="cross" class="close-icon" @click="popupVisible = false"/>
      </view>
      <view class="edit-content">
        <view v-for="(k,v) in dataList">{{ k }}</view>
      </view>
    </view>
  </uni-popup>
</template>
<script>
import UniPopup from "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue";
import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
import AJList from "../../list/aList.vue";

export default {
  name: "SMS",
  components: {AJList, UniIcons, UniPopup},
  props: {
    item: Array,
  },
  data() {
    return {
      popupVisible: false,
      dataList: []
    }
  },
  watch: {
    item: {
      handler(newVal) {
        this.dataList = newVal;
      },
      deep: true,
      immediate: true,
    }
  },
  methods: {
    open() {
      console.log(this.item)
      this.$refs.scanEditPopup.open()
      this.popupVisible = true
    },
    close() {
      this.popupVisible = false
      // 重置状态
      this.$refs.scanEditPopup.close()
    },
  }
}
</script>
<style scoped lang="scss">
.scan-edit-popup {
  background: #fff;
  border-radius: 16rpx;
  padding: 32rpx;
  width: 90%;
  margin: 0 auto;

  .edit-content {
    max-height: 70vh;
    overflow-y: auto;
  }

  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32rpx;
    border-bottom: 1rpx solid #eee;

    .title {
      font-size: 34rpx;
      font-weight: bold;
      color: #333;
    }

    .close-icon {
      font-size: 36rpx;
      color: #999;
      padding: 16rpx;
    }
  }

  .edit-content {
    view {
      width: 100%;
      text-align: center;

      text {
        padding: 0 20rpx;
        font-size: 28rpx;
        border-bottom: 1rpx solid #eee;
      }
    }
  }
}
</style>
